public class PC{
	CPU cpu;
	HardDisk HD;
	PC(){}
	PC(CPU cpu){
		this.cpu=cpu;
	}
	PC(HardDisk HD){
		this.HD=HD;
	} 
	PC(CPU cpu, HardDisk HD){
		this.cpu=cpu;
		this.HD=HD;
	}
	void setCPU(CPU c){
		this.cpu=c;
	}
	void setHardDisk(HardDisk h){
		this.HD=h;
	}
	void show(){
		System.out.println("CPU速度："+cpu.getSpeed());
		System.out.println("硬盘容量："+HD.getAmount());
	}
	public String toString(){  
		return "CPU:"+cpu.getSpeed()+",硬盘容量:"+HD.getAmount();   
	}
	public boolean equals(Object object){  
		if(object==null){        
			return false;  
		}  
		if(this==object){ 
			return true; 
		}  
		if(object instanceof PC){  
			PC s = (PC)object;    
			return this.cpu.equals(s.cpu) && this.HD.equals(s.HD);  
		}  
		return false; 
	}

}
